﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Storage_Fill.aspx.cs" Inherits="Storage_Storage_Fill" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>正贸仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">

        function fPopUpDlg()  //
        {
            if (document.getElementById('txt_Tray_ID').value == "") {
                alert('请输入托盘号！');
                return;
            }
            document.getElementById('hd').value = 1;
            document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("Storage_Info.aspx?Tray_id=" + document.getElementById('txt_Tray_ID').value, window, "dialogWidth=600px;dialogHeight=190px;scroll:no;resizable:no;status:0;");
            document.URL = location.href;
        }
        
    </script>

    <script type="text/javascript" language="javascript">
    <!--
        function SelectAllCheckBox() {
            var form = document.forms[0];
            for (i = 0; i < form.elements.length; i++) {
                if (form.elements[i].checked == false) {
                    j = 0;
                }
                else {
                    j = 1;
                }
            } if (j == 0) {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = true;
                }
            }
            else {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = false;
                }
            }
        }
        -->
    </script>

    <script type="text/javascript">
        function fPopUpCalendarDlg(URL, Target, form)  //
        {
            now = new Date();
            var rom;
            var rom1
            rom = Math.ceil(Math.random() * 10000);
            rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;

            showx = event.screenX - event.offsetX - 4; // + deltaX;
            showy = event.screenY - event.offsetY + 18; // + deltaY;
            retval = window.showModalDialog(URL + "?radmom=" + rom1, "", "dialogWidth:605px; dialogHeight:333px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; ");

            if (retval != null) {
                var Material = retval.split(",");
                document.forms(0).txt_StorageNo.value = Material[1];           //单据号
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="height: 30px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x;
                                width: 12px;">
                                &nbsp;
                            </td>
                            <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x;
                                height: 30px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 46%; vertical-align: middle;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td style="width: 5%; vertical-align: middle;">
                                                        <img src="../images/tb.gif" width="16" height="16" />
                                                    </td>
                                                    <td style="width: 95%;">
                                                        <span>你当前的位置</span>：库存管理-补货管理
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_12.gif); width: 8px;">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                    <tr>
                                        <td style="padding: 2px;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td>
                                                        <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff"
                                                            bordercolorlight="#b5d6e6">
                                                            <tr style="height: 22px;">
                                                                <td align="right" width="20%">
                                                                    入库单号：
                                                                </td>
                                                                <td style="width: 15%; padding-left: 2px; padding-right: 2px;">
                                                                    <asp:TextBox ID="txt_StorageNo" runat="server" Style="width: 120px; height: 14px;
                                                                        border: solid 1px #b5d6e6; font-size: 9pt;"></asp:TextBox>
                                                                    <input onclick="fPopUpCalendarDlg('Bill_List.aspx','Item',form1);return false;" src="../images/fc.gif"
                                                                        style="border-right: 0px; border-top: 0px; border-left: 0px; width: 14px; border-bottom: 0px;
                                                                        height: 11px" type="image" />
                                                                </td>
                                                                <td align="left">
                                                                    <asp:ImageButton ID="ibrn_S" runat="server" ImageUrl="~/Images/btn/btn_Search.gif"
                                                                        OnClick="ibrn_S_Click" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="padding: 2px;" align="center" colspan="3">
                                                                    <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 200px; overflow-x: auto;
                                                                        overflow-y: auto;">
                                                                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%"
                                                                            BorderWidth="1px" BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="PID" AllowPaging="false">
                                                                            <Columns>
                                                                                <asp:BoundField DataField="Mat_Code" HeaderText="物料编号">
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:BoundField>
                                                                                <asp:BoundField DataField="Mat_Name" HeaderText="物料名称"></asp:BoundField>
                                                                                <asp:BoundField DataField="Tray_ID" HeaderText="托盘号">
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:BoundField>
                                                                                <asp:BoundField DataField="Pos_ID" HeaderText="货位号">
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:BoundField>
                                                                                <asp:BoundField DataField="Num" HeaderText="计划数量">
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:BoundField>
                                                                                <asp:BoundField DataField="Act_Num" HeaderText="实际数量">
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:BoundField>
                                                                                <asp:TemplateField HeaderText="编辑">
                                                                                    <ItemTemplate>
                                                                                        <asp:LinkButton ID="lbtn_ZP" runat="server" CommandArgument='<%# Eval("Mat_Code")+"|"+Eval("SEC_MAT_ID")+"|"+Eval("Num")+"|"+Eval("Tray_ID")+"|"+Eval("Pos_ID")+"|"+Eval("Mat_Name") %>'
                                                                                            OnClick="lbtn_ZP_Click">确定补货</asp:LinkButton>
                                                                                    </ItemTemplate>
                                                                                    <ItemStyle Width="10%" />
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                            <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                                            <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                                        </asp:GridView>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                        <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff"
                                                            bordercolorlight="#b5d6e6">
                                                            <tr style="height: 22px;">
                                                                <td align="right" width="4%">
                                                                    托盘号：
                                                                </td>
                                                                <td style="width: 8%; padding-left: 2px; padding-right: 2px;">
                                                                    <asp:TextBox ID="txt_Tray_ID" runat="server" Style="width: 100px; height: 14px; border: solid 1px #b5d6e6;
                                                                        font-size: 9pt;"></asp:TextBox>
                                                                </td>
                                                                <td align="right" width="5%">
                                                                    物料编号：
                                                                </td>
                                                                <td style="width: 8%; padding-left: 2px; padding-right: 2px;">
                                                                    <asp:TextBox ID="txt_Mat_Code" runat="server" Style="width: 100px; height: 14px;
                                                                        border: solid 1px #b5d6e6; font-size: 9pt;"></asp:TextBox>
                                                                </td>
                                                                <td style="width: 20%; padding-left: 2px; padding-right: 2px;">
                                                                    <asp:DropDownList ID="ddlLane" runat="server" DataTextField="No_Lane" DataValueField="No_Lane">
                                                                    </asp:DropDownList>
                                                                    <asp:DropDownList ID="ddlLine" runat="server" DataTextField="No_Line" DataValueField="No_Line">
                                                                    </asp:DropDownList>
                                                                    <asp:DropDownList ID="ddlCol" runat="server" DataTextField="No_Col" DataValueField="No_Col">
                                                                    </asp:DropDownList>
                                                                    <asp:DropDownList ID="ddlLayer" runat="server" DataTextField="No_Layer" DataValueField="No_Layer">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td align="right" width="5%">
                                                                    <asp:DropDownList ID="ddlSQLIDE" runat="server" DataTextField="SQIDE" DataValueField="SQIDE">
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td align="left" width="20%">
                                                                    <asp:ImageButton ID="ibtn_Search" runat="server" ImageUrl="~/Images/btn/btn_add.gif"
                                                                        OnClick="ibtn_Search_Click" />&nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="ibtn_List" runat="server" ImageUrl="~/Images/btn/btn_AddList.gif"
                                                                        OnClientClick="fPopUpDlg()" />
                                                                    &nbsp;&nbsp;&nbsp;<asp:ImageButton ImageUrl="../images/btn/btn_zaixianpuhuo.gif"
                                                                        Width="82" ID="ibtn_ZX" runat="server" OnClick="ibtn_ZX_Click" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <div style="margin-left: 0px; margin-top: 3px; width: 100%; height: 210px; overflow-x: auto;
                                                            overflow-y: auto;">
                                                            <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                                BorderColor="#B5D6E6" CellPadding="0" AllowPaging="false">
                                                                <Columns>
                                                                    <asp:TemplateField>
                                                                        <HeaderTemplate>
                                                                            <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox()" />
                                                                        </HeaderTemplate>
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox ID="chkSelect" runat="server" Checked='<%# Bind("ck")%>' />
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="5%" />
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="id" HeaderText="编号">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Tray_ID" HeaderText="托盘号">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Pos_ID" HeaderText="货位号">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                     <asp:BoundField DataField="SEC_MAT_ID" HeaderText="物料编号">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Mat_Code" HeaderText="物料编码">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Mat_Name" HeaderText="物料名称">
                                                                        <ItemStyle HorizontalAlign="Left" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="Mat_Num" HeaderText="物料数量">
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:BoundField>
                                                                    <asp:TemplateField HeaderText="补货数量">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="txt_Num" runat="server" Width="50px" Text='<%# Bind("Num")%>' ToolTip='<%# Bind("id")%>'
                                                                                OnTextChanged="txt_Num_TextChanged" AutoPostBack="true"></asp:TextBox>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                                <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                                <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                            </asp:GridView>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                        &nbsp;&nbsp;<font color="#ff0000"><b>
                                                            <asp:Label ID="Label1" runat="server"></asp:Label></b></font>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-image: url(../images/tab_15.gif); width: 8px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 12px; height: 35px;">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hidden" runat="server" />
        <asp:HiddenField ID="hd" runat="server" />
    </div>
    </form>
</body>
</html>
